{% extends "layout.html" %}
{% block title %}测试json接口{% endblock %}
{% block head %}
{% endblock %}
{% block main_content %}
<div id="body">
  <div class="wrap">
  	<div class="gForm">
    	<div class="row">
    		<label>地址：</label>
			<input type="text" class="longinput" id="url" />
    	</div>
    	<div class="row">
    		<label>参数：</label>
			<input type="text" class="longinput" id="param" />
    	</div>
		<div class="sectBtn">
			<input type="button" onclick="doPost();" class="buttonLarge" value="测试" />
			<p id="msg" class="alert"></p>
		</div>
    </div>
  </div>
</div>
<script type="text/javascript">
	function doPost(){
		$('msg').innerHTML = '';
		var url = $('url').value; var params = $('param').value;
		if(!$chk2(url)) { new MsgBox({message:'没有输入地址'}); return; }
		new echoAjax({url:url,params:params, 
			onSuccess:function(response){
				$('msg').innerHTML = JSON.encode(response);
			}}).fire();
	}

</script>
{% endblock %}
